import { defineStore } from 'pinia'
import type { AntdDropdownOption, TenantSystem } from '@/types/system'
import { ref } from 'vue'

// 定义 Store
export const usePoundStore = defineStore(
    'pound',
    () => {

        const state = ref({
            fields: []
        })


        const setFields = (fields: Array<any>) => {
            state.value.fields = fields
        }


        // 记得 return
        return {
            state,
            setFields
        }
    },
    {
        // 网页端配置
        // persist: true,
        // 小程序端配置
        persist: {
            storage: {
                getItem(key) {
                    return uni.getStorageSync(key)
                },
                setItem(key, value) {
                    uni.setStorageSync(key, value)
                },
            },
        },
    },
)
